﻿@using Occupie.Helpers;

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8" />
    <title>@ViewBag.Title - Occupie</title>
    <link href="~/favicon.ico" rel="shortcut icon" type="image/x-icon" />
    <meta name="viewport" content="width=device-width" />
    @Styles.Render("~/Content/css")
    @Scripts.Render("~/bundles/modernizr")
    <link href="~/Content/KendoUI/kendo.common.min.css" type="text/css" rel="stylesheet" />
    <link href="~/Content/KendoUI/kendo.silver.min.css" type="text/css" rel="stylesheet" />

    <script src="~/Scripts/jquery.min.js" type="text/javascript"></script>
    <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.22/jquery-ui.min.js"></script>

    @RenderSection("scripts", required: false)

    @*Template Stuff*@

    <link rel="stylesheet" media="all" href="~/css/style.css" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <!-- Adding "maximum-scale=1" fixes the Mobile Safari auto-zoom bug: http://filamentgroup.com/examples/iosScaleBug/ -->

    <!-- JS -->
    <script src="~/js/jquery-1.7.1.min.js"></script>
    <script src="~/js/custom.js"></script>
    <script src="~/js/tabs.js"></script>
    <script src="~/js/css3-mediaqueries.js"></script>
    <script src="~/js/jquery.columnizer.min.js"></script>

    <script src="~/Scripts/kendo.all.min.js" type="text/javascript"></script>
    <script src="~/Scripts/kendo.aspnetmvc.min.js" type="text/javascript"></script>

    <!-- Isotope -->
    <script src="~/js/jquery.isotope.min.js"></script>

    <!-- Lof slider -->
    <script src="~/js/jquery.easing.js"></script>
    <script src="~/js/lof-slider.js"></script>
    <link rel="stylesheet" href="~/css/lof-slider.css" media="all" />
    <!-- ENDS slider -->

    <!-- Tweet -->
    <link rel="stylesheet" href="~/css/jquery.tweet.css" media="all" />
    <script src="~/js/tweet/jquery.tweet.js"></script>
    <!-- ENDS Tweet -->

    <!-- superfish -->
    <link rel="stylesheet" media="screen" href="~/css/superfish.css" />
    <script src="~/js/superfish-1.4.8/js/hoverIntent.js"></script>
    <script src="~/js/superfish-1.4.8/js/superfish.js"></script>
    <script src="~/js/superfish-1.4.8/js/supersubs.js"></script>
    <!-- ENDS superfish -->

    <!-- prettyPhoto -->
    <script src="~/js/prettyPhoto/js/jquery.prettyPhoto.js"></script>
    <link rel="stylesheet" href="~/js/prettyPhoto/css/prettyPhoto.css" media="screen" />
    <!-- ENDS prettyPhoto -->

    <!-- poshytip -->
    <link rel="stylesheet" href="~/js/poshytip-1.1/src/tip-twitter/tip-twitter.css" />
    <link rel="stylesheet" href="~/js/poshytip-1.1/src/tip-yellowsimple/tip-yellowsimple.css" />
    <script src="~/js/poshytip-1.1/src/jquery.poshytip.min.js"></script>
    <!-- ENDS poshytip -->

    <!-- JCarousel -->
    <script type="text/javascript" src="~/js/jquery.jcarousel.min.js"></script>
    <link rel="stylesheet" media="screen" href="~/css/carousel.css" />
    <!-- ENDS JCarousel -->

    <!-- GOOGLE FONTS -->
    <link href='http://fonts.googleapis.com/css?family=Voltaire' rel='stylesheet' type='text/css'>

    <!-- modernizr -->
    <script src="~/js/modernizr.js"></script>

    <!-- SKIN -->
    <link rel="stylesheet" media="all" href="~/css/skin.css" />

    <!-- Less framework -->
    <link rel="stylesheet" media="all" href="~/css/lessframework.css" />

    <!-- jplayer -->
    <link href="~/player-skin/jplayer-black-and-yellow.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="~/js/jquery.jplayer.min.js"></script>
    <script type="text/javascript" src="~/js/validateNav.js"></script>

    <!-- flexslider -->
    <link rel="stylesheet" href="~/css/flexslider.css">
    <script src="~/js/jquery.flexslider.js"></script>
    <link rel="stylesheet" href="~/css/list-view.css" />

    @*Template Stuff*@

</head>
<body>
    <header>
        <div class="wrapper cf">

            <div id="logo">
                <a href="~/">
                    <img src="~/img/logo.png" alt="Occupie">
                    <div style="font-family: 'Berlin Sans FB'">
                        <h3>
                            <span style="color: rgb(220,210,190);">The </span>
                            <span style="color: rgb(203,84,50);">pie </span>
                            <span style="color: rgb(220,210,190);">is not a lie</span>
                        </h3>
                    </div>
                </a>
            </div>

            <!-- nav -->
            <ul id="nav" class="sf-menu">
                <li>@Html.ActionLink("Начало", "Index", "Home")</li>
                <li>@Html.ActionLink("Студенти", "All", "Student")</li>
                <li>@Html.ActionLink("Работодатели", "All", "Employer")</li>
                <li>@Html.ActionLink("Обяви", "All", "Offer")</li>

                @{var roles = (SimpleRoleProvider)Roles.Provider;
                  var membership = (SimpleMembershipProvider)Membership.Provider;
                  var name = WebSecurity.CurrentUserName;
                }

                @if (roles.IsUserInRole(name, "employer"))
                {
                    <li>@Html.ActionLink("Добави обява", "AddOffer", "Offer")</li>
                }
                @if (Request.IsAuthenticated)
                {
                    if (roles.IsUserInRole(name, "student"))
                    {
                    <li class="sub-menu">
                        <a>@name</a>
                        @{
                        var manager = new Occupie.Managers.StudentManager();
                        }
                        @Html.Partial("_StudentPartial", manager.GetProfileIdByUserId(WebSecurity.CurrentUserId))
                    </li>
                    }
                    else if (roles.IsUserInRole(name, "employer"))
                    {
                    <li class="sub-menu">
                        <a>@name</a>
                        @{
                        var managerE = new Occupie.Managers.EmployerManager();
                        }
                        @Html.Partial("_EmployerPartial", managerE.GetProfileIdByUserId(WebSecurity.CurrentUserId))
                    </li>
                    }
                    else
                    {
                    <li class="sub-menu">
                        <a>@String.Join(",", roles.GetRolesForUser(WebSecurity.CurrentUserName))</a>
                    </li>
                    }
                }
                else
                {
                    <li class="sub-menu">
                        <a>Вход</a>
                        @Html.Partial("_LoginPartial", new Occupie.Models.LoginModel())
                    </li>
                    <li>
                        @Html.HtmlInTextActionLink("&nbsp Регистирай се <br /> като работодател", "RegisterAsEmployer", "Account", routeValues: null, htmlAttributes: new { id = "registerLink" })
                        @*@Html.Partial("_RegisterPartial")*@
                    </li>
                 
                }
            </ul>
            <div id="combo-holder"></div>
            <!-- ends nav -->

        </div>
    </header>
    <div id="main">
        <div class="wrapper cf">
            @RenderBody()
        </div>
    </div>

    <!-- FOOTER -->
    <footer>
        <div class="wrapper cf">

            <!-- widgets -->
            <ul class="widget-cols cf">
                <li class="first-col">
                    <div class="widget-block">
                        <h4>ОТ БЛОГА</h4>
                        <ul>
                            <li class="cat-item"><a href="http://occupie.openfmi.net/blog/?p=15">Dummy post (2)</a></li>
                            <li class="cat-item"><a href="http://occupie.openfmi.net/blog/?p=18">Пост с картинка</a></li>
                            <li class="cat-item"><a href="http://occupie.openfmi.net/blog/?p=10">Dummy post</a></li>
                        </ul>
                    </div>
                </li>

                <li class="second-col">
                    <div class="widget-block">
                        <h4>ЗА НАС</h4>
                        <p><a href="http://occupie.apphb.com/">Occupie</a> е система за връзка между работодателите и студентите от Факултета по математика и информатика на Софийския университет. Разработена е за състезанието HackFMI Октомври 2013.</p>
                        <p><a href="http://upload.wikimedia.org/wikipedia/commons/thumb/d/d4/Pi_pie2.jpg/220px-Pi_pie2.jpg">The pie is not a lie!</a></p>
                    </div>
                </li>

                <li class="third-col">
                    <div class="widget-block">
                        <div id="tweets" class="footer-col tweet">
                            <h4>TWITTER</h4>
                            <a class="twitter-timeline" href="https://twitter.com/search?q=%23hackfmi" data-widget-id="394382715547422721">Tweets about "#hackfmi"</a>
                            <script>!function (d, s, id) { var js, fjs = d.getElementsByTagName(s)[0], p = /^http:/.test(d.location) ? 'http' : 'https'; if (!d.getElementById(id)) { js = d.createElement(s); js.id = id; js.src = p + "://platform.twitter.com/widgets.js"; fjs.parentNode.insertBefore(js, fjs); } }(document, "script", "twitter-wjs");</script>
                        </div>
                    </div>
                </li>

                <li class="fourth-col">
                    <div class="widget-block">
                        <h4>НАВИГАЦИЯ</h4>
                        <ul>
                            <li class="cat-item">@Html.ActionLink("Начало", "Index", "Home")</li>
                            <li class="cat-item">@Html.ActionLink("Студенти", "All", "Student")</li>
                            <li class="cat-item">@Html.ActionLink("Работодатели", "All", "Employer")</li>
                            <li class="cat-item">@Html.ActionLink("Обяви", "All", "Offer")</li>
                            @{roles = (SimpleRoleProvider)Roles.Provider;
                              membership = (SimpleMembershipProvider)Membership.Provider;
                              name = WebSecurity.CurrentUserName;
                            }
                            @if (roles.IsUserInRole(name, "employer"))
                            {
                                <li class="cat-item">@Html.ActionLink("Добави обява", "AddOffer", "Offer")</li>
                            }
                            @if (Request.IsAuthenticated)
                            {
                                if (roles.IsUserInRole(name, "student"))
                                {
                                <li class="cat-item">@Html.ActionLink(User.Identity.Name, "Profile", "Student", routeValues: null, htmlAttributes: new { @class = "username" })</li> 
                                }
                                else if (roles.IsUserInRole(name, "employer"))
                                {
                                <li class="cat-item">@Html.ActionLink(User.Identity.Name, "Profile", "Employer", routeValues: null, htmlAttributes: new { @class = "username" })</li> 
                                }
                            }
                            else
                            {
                                <li class="cat-item">@Html.ActionLink("Влез като студент", "LoginAsStudent", "Account", routeValues: null, htmlAttributes: new { id = "registerLink" })</li>
                                <li class="cat-item">@Html.ActionLink("Влез като работодател", "LoginAsEmployer", "Account", routeValues: null, htmlAttributes: new { id = "registerLink" })</li>
                                <li class="cat-item">
                                    @Html.ActionLink("Регистирай се като работодател", "RegisterAsEmployer", "Account", routeValues: null, htmlAttributes: new { id = "registerLink" })
                                </li>
                            }
                        </ul>
                    </div>
                </li>
            </ul>
            <!-- ENDS widgets -->


            <!-- bottom -->
            <div class="footer-bottom">
                <div class="left">&copy; @DateTime.Now.Year Occupie</div>
            </div>
            <!-- ENDS bottom -->

        </div>
    </footer>
    <!-- ENDS FOOTER -->

    <script>
        $("#calendar").kendoCalendar();
        $("#tabstrip").kendoTabStrip();
    </script>
</body>
</html>
